package mysql

import "gorm.io/gorm"

type UserBw struct {
	gorm.Model
	Username string `gorm:"type:varchar(20);comment:账户;"`
	Password string `gorm:"type:char(32);comment:密码;"`
	Mobile   string `gorm:"type:char(18);comment:手机号;"`
}

// 手机号查询信息
func (u *UserBw) FindByMobile(mobile string) error {
	return DB.Where("mobile = ?", mobile).Find(&u).Error
}
